package main

import (
	"fmt"
	"net"
)

func main() {

	str := "862289054880212,2,36484.000,3089.20,2.231,0.46,0,0,Ele-0,E,108.0182723,N,36.1009011,2022/07/14,14:56:39\r\n"
	//str := "111"

	conn, err := net.Dial("tcp", "127.0.0.1:6007")
	if err != nil {
		fmt.Println("err : ", err)
		return
	}
	defer conn.Close()               // 关闭TCP连接
	_, err = conn.Write([]byte(str)) // 发送数据
	if err != nil {
		return
	}
	buf := [512]byte{}
	n, err := conn.Read(buf[:])
	if err != nil {
		fmt.Println("recv failed, err:", err)
		return
	}
	fmt.Println(string(buf[:n]))

}
